/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Network;

import java.awt.Color;

/**
 * 
 * @author mokoe001
 */
public class Node {
	private int id;
	private String iPAddress;
	private int numOfInflow; // num of times it acts as the source
	private int numOfOutflow; // num of times it acts as the destination
	private int bytesSent;
	private int bytesReceived;
        private Color nodeColor;

	public Node() {

	}

	public Node(int id, String ipAddress, int numOfInflow, int numOfOutflow,
			int bytesSent, int bytesReceived) {
		this.id = id;
		this.iPAddress = ipAddress;
		this.numOfInflow = numOfInflow;
		this.numOfOutflow = numOfOutflow;
		this.bytesSent = bytesSent;
		this.bytesReceived = bytesReceived;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getiPAddress() {
		return iPAddress;
	}

	public void setiPAddress(String iPAddress) {
		this.iPAddress = iPAddress;
	}

	public int getNumOfInflow() {
		return numOfInflow;
	}

	public void setNumOfInflow(int numOfInflow) {
		this.numOfInflow = numOfInflow;
	}

	public int getNumOfOutflow() {
		return numOfOutflow;
	}

	public void setNumOfOutflow(int numOfOutflow) {
		this.numOfOutflow = numOfOutflow;
	}

	public int getBytesSent() {
		return bytesSent;
	}

	public void setBytesSent(int bytesSent) {
		this.bytesSent = bytesSent;
	}

	public int getBytesReceived() {
		return bytesReceived;
	}

	public void setBytesReceived(int bytesReceived) {
		this.bytesReceived = bytesReceived;
	}

	public void incrementNumOfInFlow() {
		numOfInflow++;
	}

	public void incrementNumOfOutFlow() {
		numOfOutflow++;
	}

	public void updateBytesReceived(int br) {
		bytesReceived += br;
	}

	public void updateBytesSent(int bs) {
		bytesSent += bs;
	}

    public Color getNodeColor() {
        return nodeColor;
    }

    public void setNodeColor(Color nodeColor) {
        this.nodeColor = nodeColor;
    }
        

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
//		sb.append("id:");
//		sb.append(id);
//		sb.append(",iPAddress:");
		sb.append(iPAddress);
//		sb.append(",numOfInflow:");
//		sb.append(numOfInflow);
//		sb.append(",numOfOutflow:");
//		sb.append(numOfOutflow);
//		sb.append(",bytesSent:");
//		sb.append(bytesSent);
//		sb.append(",bytesReceived:");
//		sb.append(bytesReceived);
		return sb.toString();
	}

}
